import {defineStore} from 'pinia';
import conditionApi from "@/api/condition";

// 创建仓库
export const useConditionStore = defineStore('condition', {
  state: () => ({
    choisesList: [],// 会员专区
    choisesVideo:[],//视频专区，
    choisesLive:[], // 直播专区
    choisesOffLine:[] //线下专区
  }),
  actions: {
    // 获取选项条件列表--- 会员专区
    async getConditionList(token:any){
      let res = await conditionApi.getCondition(token)
      // @ts-ignore
      this.choisesList = res
    },
    // 获取选项条件列表--- 视频专区
    async getConditionVideo(token:any){
      let res = await conditionApi.getConditionViddo(token)
      // @ts-ignore
      this.choisesVideo = res
    },
    // 获取选项条件列表--- 直播专区
    async getConditionLive(token:any){
      let res = await conditionApi.getConditionLive(token)
      // @ts-ignore
      this.choisesLive = res
    },
    // 获取选项条件列表--- 线下专区
    async getConditionOffLine(token:any){
      let res = await conditionApi.getConditionOffLine(token)
      // @ts-ignore
      this.choisesOffLine = res
    },
  },
  getters:{

  }
})
